<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent">
    <div
      class="content-parent border-hover-style"
      :style="{
        backgroundImage: `url(${publicUrls + 'free/style7/Auxiliaryoutlinestyle3Bg.webp'})`,
      }"
    >
      <div class="audio-parent">
        <audioCom :info="props.info" ref="audioParent" />
      </div>

      <div class="content" v-if="(props.info.video && props.info.video.url) || props.info.value">
        <div class="title-box">
          {{ props.info.text }} 
        </div>
        <p class="subtitle" v-if="props.info.subTitle">——{{ props.info.subTitle }}</p>
        <div v-if="(props.info.video && props.info.video.url) || props.info.value" class="img-box">
          <img 
            class="img-shadow-1"
            :src="publicUrls + 'free/style7/Auxiliaryoutlinestyle3Bgimg1.webp'"
            alt=""
          />
          <img
            class="img-shadow-2"
            :src="publicUrls + 'free/style7/Auxiliaryoutlinestyle3Bgimg2.webp'"
            alt=""
          />
          <img
            class="img-shadow-3"
            :src="publicUrls + 'free/style7/Auxiliaryoutlinestyle3Bgimg3.webp'"
            alt=""
          />
          <img
            class="img-shadow-4"
            :src="publicUrls + 'free/style7/Auxiliaryoutlinestyle3Bgimg4.webp'"
            alt=""
          />
          <videoview
            @click="audioplay(false)"
            :info="props.info"
            v-if="props.info.video && props.info.video.url"
          ></videoview>
          <div v-else class="outline-cover">
            <img @click="ImgVisible = true" :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" />
          </div>
        </div>

        <div class="remarks1">
          <TextMax
            :color2="false"
            :infoData="props.info"
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="7"
          ></TextMax>
        </div>
      </div>
      <div class="content2" v-else>
        <div class="title-box">
          {{ props.info.text }}
        </div>
        <p class="subtitle" v-if="props.info.subTitle">——{{ props.info.subTitle }}</p> 
        <div class="remarks2" :class="{ remarks3: !props.info.subTitle }" v-if="props.info.remarks">
          <TextMax
            :color2="false"
            :infoData="props.info"
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="props.info.subTitle ? 6 : 7"
          ></TextMax>
        </div>
      </div>
    </div>
  </div>
</template> 



<script setup lang="ts">
import audioCom from './audioCom.vue';
import { publicUrls, textType } from '@/utils/minxin';
import { useProjectStore } from '@/store';
import { urls } from '@/utils/request/upload';
import { defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/textMax7.vue';
import videoview from './../../../videoDialog/videoview.vue';

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

const ImgVisible = ref(false);
const audioRef = ref(null);
const audioParent = ref(null);
const videoRef = ref(null);
const isPlay = ref(false);
const store = useProjectStore();
const audioplay = (flag: boolean = true) => {
  audioParent.value.videoplay();
};
</script>

<style scoped lang="less">
.outline-parent {
  display: flex;
  // align-items: flex-end;
  position: relative;
  margin-top: 0;
  height: 100%;
  margin-right: 140px;
}
.content-parent {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-top: 90px;
  width: 700px;
  height: 400px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  -webkit-box-reflect: below 34% linear-gradient(transparent, rgba(0, 0, 0, 0.15));
}
.audio-parent {
  position: absolute;
  bottom: 40px;
  right: 34px;
  width: 32px;
  height: 32px;
}

.title-box {
  font-family: SourceBold;
  font-size: 20px;
  color: rgba(112, 157, 134, 1);
  line-height: 30px;
}

.subtitle {
  font-family: SourceMedium;
  font-size: 16px;
  color: rgba(51, 51, 51, 1);
  line-height: 28px;
  
}
.img-box {
  margin: 26px 184px 34px 176px;
  
  position: relative;
  overflow: hidden;
  background: rgba(232, 225, 212, 1);
  width: 340px;
  height: 340px;
  padding: 10px;
  .img-shadow-1 {
     z-index: 15; 
    position: absolute;
    top: 0px;
    left: 0; 
    width: 340px;
    height: 84px;
  }  
  .img-shadow-2 {
    z-index: 15;
    position: absolute;
    bottom: 0px;
    left: 0;
    width: 340px;
    height: 84px;
  }
  .img-shadow-3 {
     z-index: 15;
    position: absolute;
    left: 0;
    top: 84px;
    width: 110px;
    height: 172px;
  }
  .img-shadow-4 {
    z-index: 15;
    position: absolute;
    right: 0px;
    top: 84px; 
    width: 110px;
    height: 172px;
  }
  :deep(video) {
    background: rgba(232, 225, 212, 1);
  }
  .outline-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    overflow: hidden;
    img {
      transition: all 0.3s;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }
}
.img-box:hover {
  .outline-cover {
    img {
      // transform: scale(1.2);
    }
  }
}

// .remarks2 {
//   width: 460px;
//   margin-top: 12px;
// }
// .remarks3 {
//   width: 460px;
//   margin-top: 16px;
// }
.content {
  position: relative;
  display: flex;
  width: 700px;
  height: 400px;
  // padding: 0 34px;
  .remarks1 {
    position: absolute;
    top: 40px;
    right: 34px;
    width: 130px;
    z-index: 20;
  }
  .title-box {
    position: absolute;
    top: 40px;
    left: 34px;
    width: 180px;
    z-index: 20;
  }
  .subtitle {
    position: absolute;
    bottom: 40px;
    left: 34px;
    width: 180px;
    z-index: 20;
  }
}
.content2 {
  position: relative;
  display: flex; 
  flex-direction: column;

  width: 700px;
  height: 400px;
  padding: 30px 54px 0 46px;

  .title-box {
    position: relative;
    width: 600px;
    text-align: center;
  }
  .subtitle {
    position: relative;
    width: 600px;
    margin-top: 10px;
    text-align: center;
  }
  .remarks2 {
    position: relative;
    width: 600px;
    margin-top: 16px;
  }
  .remarks3 {
    position: relative;
    width: 600px;
    margin-top: 24px;
  }
}
</style>
